﻿#ifndef SPEEDSEARCH_H
#define SPEEDSEARCH_H

#include <QComboBox>
#include <QWidget>
#include <QDebug>
QT_BEGIN_NAMESPACE
namespace Ui {
class SpeedSearch;

class QComboBox;
class QCompleter;
}


QT_END_NAMESPACE

class SpeedSearch : public QWidget
{
    Q_OBJECT
public:
    explicit SpeedSearch(QWidget *parent = 0);
    void initData(const QStringList &strList);
    void setEditable(bool bEnabled);
    void setCurrentText(const QString& sText);
    QString currentText();
    void setCurrentIndex(const int& nIdx);
    int currentIndex();
    void AddItem(const QString& sText);
    int Count();
    QString itemText(int idx);
    void hideSubcontrol();//掩藏下拉框
    void setPlaceholderText(QString& sText);

    ~SpeedSearch();
public slots:
    void slotCurrentIndexChanged(const QString &str);
signals:
    void currentIndexChanged(const QString&);
protected:
    void showEvent(QShowEvent *event);

private:
     Ui::SpeedSearch *ui;
    QComboBox *m_comboBox;
    QCompleter *m_completer;
};
#endif // SPEEDSEARCH_H
